<template>
  <div class="sport_index">
    <topcontent></topcontent>
    <swipe :swipecontent="swipecontent"></swipe>
    <lists></lists>
  </div>
</template>

<script>
  import swipe from "../swipe.vue"
  import lists from "./list.vue"
  import topcontent from "../index/topcontent.vue"
  var jsons = require("../../data.json")
  export default {
    data () {
      return {
          swipecontent:""
      }
    },
    components:{
      swipe,
      lists,
      topcontent
    },
    created:function(){
     this.getmsg()
    },
    mounted:function(){

    },
    watch: {
      '$route' (to, from) {
        //刷新参数放到这里里面去触发就可以刷新相同界面了
        this.getmsg()
      }
    },
    methods:{
      getmsg:function(){
        var path=this.$route.path.replace("/","")
        var url=jsons.data[path].img
        this.swipecontent=url
      }
    }

  }
</script>

<style>

</style>
